import QtQuick
import QtQuick.Controls

Rectangle {
    id: root
    width: 200
    height: 200

    // 定义状态
    states: [
        State {
            name: "expanded"
            PropertyChanges {
                target: rect1
                color: "red"
            }
            PropertyChanges {
                target: rect2
                color: "blue"
            }
        }
    ]

    Row {
        anchors.centerIn: parent
        spacing: 10
        Rectangle {
            id: rect1
            width: 50
            height: 50
            color: "red"
        }

        Rectangle {
            id: rect2
            width: 50
            height: 50
            color: "green"
        }
    }
}
